package it.learn.kafka.config;

import org.springframework.beans.factory.ObjectProvider;
import org.springframework.cloud.gateway.config.conditional.ConditionalOnEnabledGlobalFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.DispatcherHandler;

@Configuration(proxyBeanMethods = false)
public class GatewayConfig {

    @Bean
    @ConditionalOnEnabledGlobalFilter
    public CustomTestFilter customTestFilter(ObjectProvider<DispatcherHandler> dispatcherHandlerProvider) {
        return new CustomTestFilter(dispatcherHandlerProvider);
    }

}
